Remove DataTable dependency #14
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we use HANA de DataTable execute this query in the server. We (Invent) open a bug at SAP but here remove this dependence.
Sample Código :

Query Executada Automáticamente :
SELECT
T1.SCHEMA_NAME
,T1.TABLE_NAME
,T1.COLUMN_NAME
,T1.POSITION
,T1.IS_NULLABLE
,CASE WHEN COUNT(*) OVER (PARTITION BY T2.SCHEMA_NAME, T2.TABLE_NAME, T2.COLUMN_NAME, T2.INDEX_NAME)=1 AND T2.CONSTRAINT LIKE '%UNIQUE%' THEN 'TRUE' ELSE NULL END IS_UNIQUE
,CASE WHEN T2.CONSTRAINT = 'PRIMARY KEY' THEN 'TRUE' ELSE NULL END IS_PRIMARY_KEY
,CASE WHEN T2.CONSTRAINT LIKE '%UNIQUE%' THEN T2.INDEX_NAME ELSE NULL END INDEX_NAME
,CASE WHEN T2.CONSTRAINT LIKE '%UNIQUE%' THEN T2.IS_UNIQUE_ALTPK ELSE NULL END IS_UNIQUE_ALTPK
FROM
SYS.TABLE_COLUMNS T1
LEFT OUTER JOIN (SELECT
SCHEMA_NAME
,TABLE_NAME
,INDEX_NAME
,COLUMN_NAME
,CONSTRAINT
,'TRUE' AS IS_UNIQUE_ALTPK
FROM
SYS.INDEX_COLUMNS
WHERE
CONSTRAINT IN ('NOT NULL UNIQUE','UNIQUE','PRIMARY KEY')) T2
ON (T1.SCHEMA_NAME = T2.SCHEMA_NAME) AND (T1.TABLE_NAME = T2.TABLE_NAME) AND (T1.COLUMN_NAME = T2.COLUMN_NAME)
WHERE
(NOT (T1.SCHEMA_NAME IN ('SYS'))
AND NOT (T1.SCHEMA_NAME LIKE 'SYS%')
AND (T1.TABLE_NAME = ?)
)
ORDER BY
T1.SCHEMA_NAME
,T1.TABLE_NAME